import request from '@/utils/request'
// 组织架构的接口

/**
 *  获取部门列表
 */
export const reqGetDepartments = () => {
  return request({
    method: 'get',
    url: '/company/department'
  })
}

/**
 * 根据ID删除部门
 */
export const reqDelDepartments = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

/**
 * 新增部门
 */
export const reqAddDeparment = (obj) => request({
  method: 'post',
  url: `/company/department`,
  data: obj
})

/** *
 * 获取部门详情
 * ***/
export function reqGetDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

/**
 * 编辑部门
 ***/
export function reqUpdateDepartments(form) {
  return request({
    method: 'put',
    url: `/company/department/${form.id}`
    // data: form
  })
}
